package com.graduation.community_manager.common;

import lombok.Getter;
import lombok.Setter;

/**
 * @author wdh
 */
@Setter
@Getter
public class ResultData {
    public static final int SUCCESS = 20000;
    public static final int FAIL = 40000;
    int code;
    String message;
    Object data;

    public static ResultData success(String message,Object data){
        ResultData rd = new ResultData();
        rd.setData(data);
        rd.setMessage(message);
        rd.setCode(SUCCESS);
        return rd;
    }

    public static ResultData fail(String message,Object data){
        ResultData rd = new ResultData();
        rd.setCode(FAIL);
        rd.setData(data);
        rd.setMessage(message);
        return rd;
    }
}
